<template>
  <view>
    <u-navbarsearch height="80px">
      <template #center>
        <view style="flex: 1">
          <u-search
            shape="square"
            placeholder="搜索电站"
            height="80rpx"
            v-model="searchstr"
            @search="search"
            @custom="search"
          ></u-search>
        </view>
      </template>
    </u-navbarsearch>
    <view
      v-for="(item, index) in list"
      :key="index"
      style="padding: 10rpx 32rpx"
    >
      <caritem :item="item"></caritem>
    </view>
    <u-loadmore :status="status" loadingIcon="circle" />
    <view style="height: 1px"></view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        searchstr: "",
        status: "",
        list: [],
      };
    },
    methods: {
      async search() {
        if (this.status == "loading" || this.searchstr == "") {
          return;
        }
        this.status = "loading";
        let StationCar = await this.$z.request("/StationCar", {
          pcs: this.searchstr,
        });
        this.list = StationCar;
        this.status = "nomore";
        console.log(123456, StationCar);
      },
    },
  };
</script>

<style lang="scss">
  // page {
  //   background: #f3f4f8;
  // }
</style>
